package com.agricultural.robot.state;

import com.agricultural.robot.model.AgriculturalMachine;

/**
 * 空闲状态 - 状态模式
 */
public class IdleState implements MachineState {
    @Override
    public void start(AgriculturalMachine machine) {
        System.out.println(machine.getName() + " 启动，进入工作状态");
        machine.setState(new WorkingState());
    }

    @Override
    public void stop(AgriculturalMachine machine) {
        System.out.println(machine.getName() + " 已经处于空闲状态");
    }

    @Override
    public void pause(AgriculturalMachine machine) {
        System.out.println(machine.getName() + " 已经处于空闲状态，无法暂停");
    }

    @Override
    public void resume(AgriculturalMachine machine) {
        System.out.println(machine.getName() + " 已经处于空闲状态，无需恢复");
    }

    @Override
    public String getStatus() {
        return "空闲";
    }
}
